<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@include file="/WEB-INF/jsp/include/header.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<title>仓储管理系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.7.1.min.js"></script>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui-1.2.5/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui-1.2.5/themes/icon.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/table.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-1.2.5/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-1.2.5/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-1.2.5/plugins/jquery.validatebox.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui-1.2.5/validatebox.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/globalMaps.js"></script>
		<script type="text/javascript">
			var mgaa = '${purmg.mgaa}';
			var mgab = '${purmg.mgab}';
			var mgac = '${purmg.mgac}';
			<c:forEach items="${globalUmUser.mdafs}" var="mdaf" varStatus="s">
				globalMaps.put('${mdaf}', '${mdaf}');
			</c:forEach>
		</script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/pur/purmh.js"></script>
	</head>
	<body>
		<div id="menuDiv" style="padding:5px;background:#fafafa;width:980px;"></div>
		<div id="listDiv" style="padding:3px 2px;height:30px;width:980px">
			<table>
				<tr>
					<td align="right">单别：</td>
					<td align="left"><input type="text" class="easyui-validatebox" id="purmgAa" name="mgab" maxlength="20" required="true" value="${purmg.mgaa}" readOnly="readonly" /></td>

					<td align="right">单号：</td>
					<td align="left"><input type="text" class="easyui-validatebox" id="purmgAb" name="mgab" maxlength="20" required="true" value="${purmg.mgab}" readOnly="readonly"/></td>
					<td align="right">单据日期：</td>
					<td align="left"><input type="text" name="mgad" id="purmgAd" class="easyui-validatebox" maxlength="20" required="true" value="${purmg.mgad}" readOnly="readonly"></td>
				</tr>
			</table>
		</div>
		<!-- 表格 -->
		<table id="purmhTable" border="0" cellspacing="0" cellpadding="0" width="98%" pagination="true" remoteSort="false" singleSelect="false" idField="mhac" showFooter="false" striped="true" url="<c:url value='/purmh/purmhList.xhtml'><c:param name="mgaa" value="${mgaa}"/><c:param name="mgab" value="${mgab}"/></c:url>">
			<thead>
				<tr align="center">
					<th field="mhac" width="70">序号</th>
					<th field="mhad" width="100" >物料编号</th>
					<th field="mham" width="100">库位</th>
					<th field="mhae" width="100">包号</th>
					<th field="mhaf" width="50" >数量</th>
					<th field="mhag" width="50">单位</th>
					<th field="mhah" width="70">净重</th>
					<th field="mhai" width="100">毛重</th>
					<th field="mhaj" width="50" >采购单单别</th>
					<th field="mhak" width="100">单号</th>
					<th field="mhal" width="50">行号</th>
				</tr>
			</thead>
		</table>
		
		<!-- 添加 -->
		<div id="purmhAdd" icon="icon-save" style="padding:5px;width:300px;height:400px;">
			<form method="post" name="addForm" id="addForm">
				<input type="hidden" id="purmhAddMhaa" name="mhaa" value="${mgaa}"/>
				<input type="hidden" id="purmhAddMhab" name="mhab" value="${mgab}"/>
				<div class="ToolTip_Form" id="purmhAddForm" onkeydown="if(event.keyCode==13){purmhAdd();}">
					<table>
						<tr>
							<td align="right">库位：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMham" name="mham" required="true" missingMessage="库位不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">物料编号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhad" name="mhad" required="true" missingMessage="物料编号不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">批次号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhae" name="mhae" required="true" missingMessage="批次号不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">数量：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhaf" name="mhaf"  required="true" validType="isDouble" missingMessage="数量不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">单位：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhag" name="mhag" required="true" missingMessage="单位不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">净重：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhah" name="mhah" required="true" validType="isDouble" missingMessage="净重不能为空!" /></td>
						</tr>
						<tr>
							<td align="right">毛重：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhai" name="mhai" required="true" validType="isDouble" missingMessage="毛重不能为空!"></td>
						</tr>
						
						<tr>
							<td align="right">采购单别：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhaj" name="mhaj"  /></td>
						</tr>
						<tr>
							<td align="right">采购单号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhak" name="mhak" /></td>
						</tr>
						<tr>
							<td align="right">行号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhAddMhal" name="mhal"  required="true" validType="isDouble" /></td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<a href="#" class="easyui-linkbutton" icon="icon-ok" onclick="purmhAdd();">提交</a>
								<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="closeDialogAdd();">关闭</a>
							</td>
						</tr>
					</table>
				</div>
			</form>
		</div>
		<!-- 编辑 -->
		<div id="purmhUpdate" icon="icon-save" style="padding:5px;width:300px;height:400px;">
			<form method="post" name="updateForm" id="updateForm">
				<input type="hidden" id="purmhUpdateMhaa" name="mhaa" value="${mgaa}"/>
				<input type="hidden" id="purmhUpdateMhab" name="mhab" value="${mgab}"/>
				<input type="hidden" id="purmhUpdateMhac" name="mhac" value=""/>
				<div class="ToolTip_Form" id="purmhUpdateForm" onkeydown="if(event.keyCode==13){purmhUpdate();}">
					<table>
						<tr>
							<td align="right">库位：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMham" name="mham" required="true" missingMessage="库位不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">物料编号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhad" name="mhad" required="true" missingMessage="物料编号不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">批次号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhae" name="mhae" required="true" missingMessage="批次号不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">数量：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhaf" name="mhaf"  required="true" validType="isDouble" missingMessage="数量不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">单位：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhag" name="mhag" required="true" missingMessage="单位不能为空!"/></td>
						</tr>
						<tr>
							<td align="right">净重：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhah" name="mhah" required="true" validType="isDouble" missingMessage="净重不能为空!" /></td>
						</tr>
						<tr>
							<td align="right">毛重：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhai" name="mhai" required="true" validType="isDouble" missingMessage="毛重不能为空!"></td>
						</tr>
						
						<tr>
							<td align="right">采购单别：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhaj" name="mhaj"  /></td>
						</tr>
						<tr>
							<td align="right">采购单号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhak" name="mhak" /></td>
						</tr>
						<tr>
							<td align="right">行号：</td>
							<td align="left"><input type="text" class="easyui-validatebox" id="purmhUpdateMhal" name="mhal"  required="true" validType="isDouble" /></td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<a href="#" class="easyui-linkbutton" icon="icon-ok" onclick="purmhUpdate();">提交</a>
								<a href="#" class="easyui-linkbutton" icon="icon-redo" onclick="closeDialogUpdate();">关闭</a>
							</td>
						</tr>
					</table>
				</div>
			</form>
		</div>
	</body>
</html>